package cn.xopencode.appletweb.controller.user;


import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.userservice.rpc.user.UserRpc;
import cn.xopencode.userservice.rpc.user.dto.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "用户信息管理")
@RestController
@RequestMapping("/user")
@Validated
public class UserController {

    @DubboReference(version = "${dubbo.consumer.UserRpc.version}")
    private UserRpc userRpc;

    @ApiOperation(value = "查询单个用户信息")
    @GetMapping("/get/{userId}")
    public CommonResult<UserDTO> getUser(@RequestBody @PathVariable("userId") String userId) {
        return userRpc.getUser(userId);
    }

}
